/* 
 * Author      		: Adnin Devit CF 
 * Date Created		: 31-Maret-2011 
 * Date Modified	: 6-April-2011 
 * Version			: 1.1 
 * */
package jtk.project4.fleet.field;

import java.awt.Checkbox;
import java.awt.Dimension;
import java.text.SimpleDateFormat;

//import jtk.project4.fleet.domain.MaintenanceHistory;
import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.FormLayout.Resize;
import nl.coderight.jazz.form.control.CalendarControl;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.ComboField;
import nl.coderight.jazz.form.field.button.CheckButton;

public class DataIntervalSettingsField extends GroupControl<String>{
	private CheckButton enableDataRange;
	private CalendarControl date0;
	private CalendarControl date1;
	
	public DataIntervalSettingsField(String bindID){
		setTitle("header.Data Interval Settings");
		setBindID(bindID);
		createFields();
		createLayout();
	}
	
	private void createFields(){
		enableDataRange = new CheckButton("Enable Data Range");
		
		date0 = new CalendarControl("date0", 20);
		date0.setFormat(new SimpleDateFormat());
		date0.showYearSpinner(true);
		date0.setPreferredSize(new Dimension(166,20));
		
		
		date1 = new CalendarControl("date1", 20);
		date1.setFormat(new SimpleDateFormat());
		date1.showYearSpinner(true);
		date1.setPreferredSize(new Dimension(166,20));
	}
	
	private void createLayout(){
		setLayout(new FormLayout())
		.addField(enableDataRange)
		.addRow()
		.addField(date0).addLabel("through")
		.addField(date1);
	}
}
